// with polyfills
import 'core-js/stable';
import 'regenerator-runtime/runtime';

import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store/';
import i18n from './locales';

import { VueAxios } from './utils/request';
import { hasBtnAuth, hasRouteAuth } from './utils/util'
import DraggableSider from './components/common/DraggableSider'
import SiderToggle from './components/common/SiderToggle'

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock';

import bootstrap from './core/bootstrap';
import './core/lazy_use';
import './permission'; // permission control
import './utils/filter'; // global filter
import './components/global.less';
Vue.prototype.$auth = hasBtnAuth
Vue.prototype.$hasRouteAuth = hasRouteAuth
Vue.config.productionTip = false;

Vue.component('draggable-sider', DraggableSider)
Vue.component('sider-toggle', SiderToggle)

// mount axios Vue.$http and this.$http
Vue.use(VueAxios);

window.app = new Vue({
  router,
  store,
  i18n,
  created: bootstrap,
  render: h => h(App)
}).$mount('#app');
